<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<h1>定时器</h1>
				<script>
				
				
					// var t = setInterval(定时要执行的函数,间隔);
					
					var i = 0;
					
					function foo1()
					{
						console.log(i+"hello world");
						i++;
						if(i==5)
						{
							clearInterval(t);
						}
					}
					var t = setInterval(foo1,1000);
					
					// setTimeOut(定时要执行的函数,间隔))
					// clearTimeOut(定时器)
					
					
				</script>
	</body>
</html>
